using UnityEngine;

public class TutorialInterface : MonoBehaviour
{
	private static TutorialInterface instance;

	private static GameObject parentObject;

	public TutorialTouchView touchView;

	public TutorialRecordControl recordControl;

	public static TutorialInterface GetInstance()
	{
		if (!instance)
		{
			parentObject = GameObject.Find("Tutorial Canvas");
			if (parentObject != null)
			{
				instance = parentObject.GetComponent<TutorialInterface>();
			}
		}
		return instance;
	}

	private void Start()
	{
		GetInstance();
	}

	public static void ShowSwipe(Vector3 startPos, Vector3 endPos, float duration, bool showHand = true)
	{
		if (!(instance == null))
		{
			instance.touchView.ShowSwipe(startPos, endPos, duration, showHand);
		}
	}

	public static void SetActive(bool active = true, bool showControls = false, bool refreshRecord = false)
	{
		if (!(instance == null))
		{
			instance.touchView.gameObject.SetActive(active);
			instance.recordControl.gameObject.SetActive(active);
			if (refreshRecord)
			{
				instance.recordControl.RefreshRecording();
			}
			instance.recordControl.ShowControls(showControls);
		}
	}

	public static void Play()
	{
		instance.recordControl.PlayFromResources();
	}

	public static void StopAll()
	{
		instance.recordControl.StopAll();
	}
}
